<?php

namespace App\Http\Requests\Admin\News;
use App\Http\Requests\Request;

class Create extends Request{
    public function authorize(){
        return true;
    }
    public function rules(){
        $input = $this->all();
        return [
            'title'=>'required|max:100',
            'source'=>'max:100',
            'publisher'=>'max:50',
            'category'=>'required|max:5',
            'style'=>'max:50',
            'editorValue'=>'required|max:41000',
        ];
    }
    public function messages(){
        return [
            'title.required'=>'标题不能为空',
            'title.max'=>'标题最多100个字',
            'source.max'=>'来源最多100个字',
            'publisher.max'=>'发布者最多50个字',
            'category.required'=>'请选择二级类',
            'category.max'=>'请选择二级类',
            'style.max'=>'色彩信息最多50个字',
            'editorValue.required'=>'信息内容不能为空',
            'editorValue.max'=>'信息最多10000个字',
        ];
    }
}
